<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>LuaApp项目接口文档</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>LuaApp</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="nowrap">
  <li><a href="../classes/ActivityIndicatorView.html">ActivityIndicatorView</a></li>
  <li><a href="../classes/AlertView.html">AlertView</a></li>
  <li><a href="../classes/Application.html">Application</a></li>
  <li><a href="../classes/AudioEngine.html">AudioEngine</a></li>
  <li><a href="../classes/Button.html">Button</a></li>
  <li><a href="../classes/CaptureView.html">CaptureView</a></li>
  <li><a href="../classes/CheckBox.html">CheckBox</a></li>
  <li><a href="../classes/ClippingView.html">ClippingView</a></li>
  <li><a href="../classes/Control.html">Control</a></li>
  <li><a href="../classes/DatePickerView.html">DatePickerView</a></li>
  <li><strong>Device</strong></li>
  <li><a href="../classes/DownloadManager.html">DownloadManager</a></li>
  <li><a href="../classes/DrawView.html">DrawView</a></li>
  <li><a href="../classes/DrawerController.html">DrawerController</a></li>
  <li><a href="../classes/FileUtils.html">FileUtils</a></li>
  <li><a href="../classes/GifView.html">GifView</a></li>
  <li><a href="../classes/HttpClient.html">HttpClient</a></li>
  <li><a href="../classes/HttpRequest.html">HttpRequest</a></li>
  <li><a href="../classes/Image.html">Image</a></li>
  <li><a href="../classes/ImageView.html">ImageView</a></li>
  <li><a href="../classes/Label.html">Label</a></li>
  <li><a href="../classes/LinearView.html">LinearView</a></li>
  <li><a href="../classes/ListView.html">ListView</a></li>
  <li><a href="../classes/ListViewCell.html">ListViewCell</a></li>
  <li><a href="../classes/NavController.html">NavController</a></li>
  <li><a href="../classes/Progress.html">Progress</a></li>
  <li><a href="../classes/Slider.html">Slider</a></li>
  <li><a href="../classes/Stepper.html">Stepper</a></li>
  <li><a href="../classes/Switch.html">Switch</a></li>
  <li><a href="../classes/TabBarController.html">TabBarController</a></li>
  <li><a href="../classes/TextField.html">TextField</a></li>
  <li><a href="../classes/TextView.html">TextView</a></li>
  <li><a href="../classes/UILoader.html">UILoader</a></li>
  <li><a href="../classes/View.html">View</a></li>
  <li><a href="../classes/ViewController.html">ViewController</a></li>
  <li><a href="../classes/WebView.html">WebView</a></li>
  <li><a href="../classes/Window.html">Window</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/Animation.html">Animation</a></li>
  <li><a href="../modules/class.html">class</a></li>
  <li><a href="../modules/constants.html">constants</a></li>
  <li><a href="../modules/crossapp.html">crossapp</a></li>
  <li><a href="../modules/cjson.html">cjson</a></li>
  <li><a href="../modules/mobdebug.html">mobdebug</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
  <li><a href="../topics/readme.md.html">readme</a></li>
  <li><a href="../topics/layout.md.html">layout</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>Device</code></h1>
<p>设备接口，通过 ca.sharedDevice() 获取当前实例</p>
<p>

</p>


<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Device:getSystemVersionWithIOS">Device:getSystemVersionWithIOS (version)</a></td>
	<td class="summary">获取ios系统版本</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getAppVersion">Device:getAppVersion (version)</a></td>
	<td class="summary">获取App版本</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:openCamera">Device:openCamera (callback)</a></td>
	<td class="summary">打开摄像头捕获图片</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:openAlbum">Device:openAlbum (callback)</a></td>
	<td class="summary">打开相册获取图片</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getScreenBrightness">Device:getScreenBrightness ()</a></td>
	<td class="summary">获取屏幕亮度</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:setScreenBrightness">Device:setScreenBrightness (brightness)</a></td>
	<td class="summary">设置屏幕亮度</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getAddressBook">Device:getAddressBook (bookList)</a></td>
	<td class="summary">设置联系人</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:updateVersion">Device:updateVersion (url, versionNumber, appid)</a></td>
	<td class="summary">更新版本</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getNetWorkType">Device:getNetWorkType ()</a></td>
	<td class="summary">获取网络类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getWifiListWithAndroid">Device:getWifiListWithAndroid (callback)</a></td>
	<td class="summary">获取wifi列表</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getWifiConnectionInfo">Device:getWifiConnectionInfo ()</a></td>
	<td class="summary">获取连接的wifi信息</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:setVolume">Device:setVolume (volume, VolumeType)</a></td>
	<td class="summary">设置音量</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getVolume">Device:getVolume (VolumeType)</a></td>
	<td class="summary">获取音量</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:OpenURL">Device:OpenURL (url)</a></td>
	<td class="summary">打开url</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:getBatteryLevel">Device:getBatteryLevel (level)</a></td>
	<td class="summary">获取电量</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:isNetWorkAvailble">Device:isNetWorkAvailble ()</a></td>
	<td class="summary">获取网络是否可用</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:sendLocalNotification">Device:sendLocalNotification (title, content, time)</a></td>
	<td class="summary">发送通知</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:writeToSavedPhotosAlbum">Device:writeToSavedPhotosAlbum (img, name)</a></td>
	<td class="summary">保存Image到相册</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:setBlueToothType">Device:setBlueToothType (BlueToothType)</a></td>
	<td class="summary">设置蓝牙类型</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:startGyroscope">Device:startGyroscope (callback)</a></td>
	<td class="summary">开启定位</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:setGyroInterval">Device:setGyroInterval (interval)</a></td>
	<td class="summary">设置定位时间间隔</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Device:stopGyroscope">Device:stopGyroscope ()</a></td>
	<td class="summary">停止定位</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Methods"></a>Methods</h2>

    <dl class="function">
    <dt>
    <a name = "Device:getSystemVersionWithIOS"></a>
    <strong>Device:getSystemVersionWithIOS (version)</strong>
    </dt>
    <dd>
    获取ios系统版本


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">version</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getAppVersion"></a>
    <strong>Device:getAppVersion (version)</strong>
    </dt>
    <dd>
    获取App版本


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">version</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:openCamera"></a>
    <strong>Device:openCamera (callback)</strong>
    </dt>
    <dd>
    打开摄像头捕获图片


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">callback</span>
            <span class="types"><span class="type">function</span></span>
         (Image)
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:openAlbum"></a>
    <strong>Device:openAlbum (callback)</strong>
    </dt>
    <dd>
    打开相册获取图片


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">callback</span>
            <span class="types"><span class="type">function</span></span>
         (Image)
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getScreenBrightness"></a>
    <strong>Device:getScreenBrightness ()</strong>
    </dt>
    <dd>
    获取屏幕亮度



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
        brightness
    </ol>




</dd>
    <dt>
    <a name = "Device:setScreenBrightness"></a>
    <strong>Device:setScreenBrightness (brightness)</strong>
    </dt>
    <dd>
    设置屏幕亮度


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">brightness</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getAddressBook"></a>
    <strong>Device:getAddressBook (bookList)</strong>
    </dt>
    <dd>
    设置联系人


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">bookList</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
        book表内包含firstName,lastName,middleName,prefix,suffix,nickname,firstNamePhonetic,
lastNamePhonetic,middleNamePhonetic,organization,jobtitle,department,birthday,note,
lastEdit,email,country,city,province,street,zip,countrycode,phoneNumber,fullname
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:updateVersion"></a>
    <strong>Device:updateVersion (url, versionNumber, appid)</strong>
    </dt>
    <dd>
    更新版本


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">url</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">versionNumber</span>
            <span class="types"><span class="type">int</span></span>



        </li>
        <li><span class="parameter">appid</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getNetWorkType"></a>
    <strong>Device:getNetWorkType ()</strong>
    </dt>
    <dd>
    获取网络类型



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">int</span></span>
         NetWorkType
NetWorkTypeWifi = 0,
NetWorkType3G = 1,
NetWorkTypeNone = 2
    </ol>




</dd>
    <dt>
    <a name = "Device:getWifiListWithAndroid"></a>
    <strong>Device:getWifiListWithAndroid (callback)</strong>
    </dt>
    <dd>
    获取wifi列表


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">callback</span>
            <span class="types"><span class="type">function</span></span>
        callback(list)
list内元素包含level,mac,ssid
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getWifiConnectionInfo"></a>
    <strong>Device:getWifiConnectionInfo ()</strong>
    </dt>
    <dd>
    获取连接的wifi信息



    <h3>Returns:</h3>
    <ol>

           <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
        info 包含level,mac,ssid
    </ol>




</dd>
    <dt>
    <a name = "Device:setVolume"></a>
    <strong>Device:setVolume (volume, VolumeType)</strong>
    </dt>
    <dd>
    设置音量


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">volume</span>
            <span class="types"><span class="type">float</span></span>



        </li>
        <li><span class="parameter">VolumeType</span>
            <span class="types"><span class="type">int</span></span>
        VolumeMusic = 0,
VolumeSystem = 1,
VolumeRing = 2,
VolumeVoicCall = 3,
VolumeAlarm = 4,
VolumeNotification = 5
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getVolume"></a>
    <strong>Device:getVolume (VolumeType)</strong>
    </dt>
    <dd>
    获取音量


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">VolumeType</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">float</span></span>
        volume
    </ol>




</dd>
    <dt>
    <a name = "Device:OpenURL"></a>
    <strong>Device:OpenURL (url)</strong>
    </dt>
    <dd>
    打开url


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">url</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:getBatteryLevel"></a>
    <strong>Device:getBatteryLevel (level)</strong>
    </dt>
    <dd>
    获取电量


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">level</span>
            <span class="types"><span class="type">float</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:isNetWorkAvailble"></a>
    <strong>Device:isNetWorkAvailble ()</strong>
    </dt>
    <dd>
    获取网络是否可用



    <h3>Returns:</h3>
    <ol>

           <span class="types"><span class="type">bool</span></span>
        availble
    </ol>




</dd>
    <dt>
    <a name = "Device:sendLocalNotification"></a>
    <strong>Device:sendLocalNotification (title, content, time)</strong>
    </dt>
    <dd>
    发送通知


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">title</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">content</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
        <li><span class="parameter">time</span>
            <span class="types"><span class="type">int</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:writeToSavedPhotosAlbum"></a>
    <strong>Device:writeToSavedPhotosAlbum (img, name)</strong>
    </dt>
    <dd>
    保存Image到相册


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">img</span>
            <span class="types"><a class="type" href="../classes/Image.html#">Image</a></span>



        </li>
        <li><span class="parameter">name</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:setBlueToothType"></a>
    <strong>Device:setBlueToothType (BlueToothType)</strong>
    </dt>
    <dd>
    设置蓝牙类型


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">BlueToothType</span>
            <span class="types"><span class="type">int</span></span>
        CABLUETOOTHOPEN = 0,
CABLUETOOTHCLOSE = 1,
CABLUETOOTHDISCOVERY = 3,
CABLUETOOTHCANCELDISCOVERY = 4
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:startGyroscope"></a>
    <strong>Device:startGyroscope (callback)</strong>
    </dt>
    <dd>
    开启定位


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">callback</span>
            <span class="types"><span class="type">function</span></span>
        callback参数包含x,y,z,timestamp属性
        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:setGyroInterval"></a>
    <strong>Device:setGyroInterval (interval)</strong>
    </dt>
    <dd>
    设置定位时间间隔


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">interval</span>
            <span class="types"><span class="type">float</span></span>



        </li>
    </ul>





</dd>
    <dt>
    <a name = "Device:stopGyroscope"></a>
    <strong>Device:stopGyroscope ()</strong>
    </dt>
    <dd>
    停止定位







</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2017-04-25 21:28:27 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
